
public class Lista implements Structura{
	private int [] elements; 
	public void adauga (int elem){
		elements[elements.length+1] = elem;
	}
	public void sterge (int elem){
		int [] buffer = new int[0];
		for (int i=0; i<elements.length-1; i++)
			 buffer[i] = elements[i];
		elements = buffer;
	}
	public void inserare (int elem, int location){
		int bufferLength = (elements.length - location)+1;
		int [] buffer = new int [bufferLength];
		for (int i=location; i<elements.length; i++)
			for (int j=0; j<bufferLength; j++)
			buffer[j] = elements[i];
		elements[location] = elem;
		for (int i=(location+1); i<elements.length; i++)
			for (int j=0; j<bufferLength; j++)
				elements[i] = buffer[j];
	}
	/* Constructor:*/
	public Lista(int [] elements){
		this.elements = elements;
	}
}
